extends "../kelifulan-1/kelifulan-1.gd"


func _extInit():
	._extInit()
	lv = 2             #等级的设置
	addSkill("每{cd}秒赋予当前目标<强袭号令>，持续4秒", "强袭号令", "qxhl", 8)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "qxhl":
		qxhl()

func qxhl():
	if aiCha == null:return
	if aiCha.hasBuff("b_qxhl") == null:
		castBuff(aiCha, b_qxhl.new(4))
	if upgraded == 1:
		var index = 0
		for i in getAllChas(1):
			if index >= 2:break
			if i.hasBuff("b_qxhl") == null:
				castBuff(i, b_qxhl.new(4))
				index += 1

class b_qxhl:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init(lv = 1):
		attInit()
		id = "b_qxhl"
		life = lv
		isNegetive=true
		att.defR = -0.3
		buffName = "强袭号令"
	func _connect():
		._connect()
		if masCha.team == 1:return
		masCha.connect("onDeath", self, "onDeath")
	func onDeath(atkInfo):
		sys.main.player.plusGold(8)